﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ExceptionHandling
{
    class InvalidRangeException<T> : ApplicationException
    {
        private T min;
        private T max;

        public T Min 
        {
            get { return this.min; } 
        }
        public T Max 
        { 
            get { return this.max; } 
        }


        public InvalidRangeException(T min, T max)
        {

            this.min = min;
            this.max = max;
        }

        public override string Message
        {
            get
            {
                string errorMsg = string.Format("value must be in range between {0} and {1}", this.Min, this.Max);
                return errorMsg;
            }
        }
    }
}
